package com.wl4837;

public class App
{
    public static void main( String[] args )
    {
        PaymentContext context = new PaymentContext();

        // 使用支付宝支付
        context.setPaymentStrategy(new AliPay());
        context.pay(100);

        // 切换为微信支付
        context.setPaymentStrategy(new WeChatPay());
        context.pay(200);
    }
}
